package cn.wbnyua.resume.mvc.mapper;

import cn.wbnyua.resume.mvc.domain.Award;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AwardMapper {
    
    @Select("select * from award")
    List<Award> findAll();
    @Select("select * from award where id = #{id}")
    Award findById(Long id);
    @Insert("INSERT INTO `myself`.`award` (`name`, `level`) VALUES (#{name},#{level})")
    int add(Award award);

    @Update("UPDATE `myself`.`award` SET `name` = #{name}, `level` = #{level} WHERE `id` = 1;")
    int update(Award award);

    @Delete("delete from award where id = #{id}")
    int remove(Long id);
}
